<?php
/*
 * APP基础类
 */

namespace Lib\Base;

class CurrentRequest
{
    private $param = array();

    public function __construct($request, $response)
    {
        $this->request = $request;
        $this->response = $response;

        global $g_debug_log;

        if (defined('RUN_DEBUG') && RUN_DEBUG) {
            $g_debug_log = true;
        } else {
            $g_debug_log = false;
        }

        global $g_log_level;
        if (defined('LOG_LEVEL')) {
            $g_log_level = LOG_LEVEL;
        } else {
            $g_log_level = 999999;
        }
    }

    public function get($key)
    {
        if (array_key_exists($key, $this->param)) {
            return $this->param[$key];
        }
        return "";
    }

    public function set($key, $value)
    {
        $this->param[$key] = $value;
    }
}
